﻿using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;

namespace PaulBeck.Timesheet.WebParts.Consultant
{
    [ToolboxItemAttribute(false)]
    public class Consultant : WebPart, BOL.Interface.IResource
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        private const string _ascxPath = @"~/_CONTROLTEMPLATES/PaulBeck.Timesheet.WebParts/Consultant/ConsultantUserControl.ascx";

        Control control;

        protected override void CreateChildControls()
        {
            control = Page.LoadControl(_ascxPath);
            Controls.Add(control);
        }

        public int GetResourceId
        {
            get 
            {
                ConsultantUserControl cuc = (ConsultantUserControl)control;
                return cuc.GetResourceId();
            }
        }

        [ConnectionProvider("ResourceId", "ResourceId", AllowsMultipleConnections = true)]
        public BOL.Interface.IResource GetResource()
        {
            EnsureChildControls();
            return this;
        }



    }
}
